<template>
        
        <div class="spare-a" id="container">
			<div class="questions-ar">
				<div class="spare-ara" >
					<div class="spare-ara-a clearfix">
						<div class="spare-ara-al">
							<div class="spare-ara-all"><input type="text" placeholder="请输入关键字"  v-model="content"/></div>
							<div class="spare-ara-alr"  v-on:click="getDatas(content)"></div>
						</div>
						<div class="spare-ara-ar">
                                <!-- <router-link to="/help/search" ref="search" class="spare-tj">
                                    高级搜索
                                </router-link> -->
                               <button type="button" @click="toHelp()" class="spare-tj">高级搜索</button>
						</div>
						
					</div>
					<div class="srcoll-documentation" >
					<div class="documentation paper" >
							<ul>
                                <a href="#"  >
                                    <li v-for="data in datas" :key="data.id">
                                        <router-link :to="{ name: 'Content', params: { id: data.id,title:data.title}}">
                                            <div class="paper-a" ><a>{{data.title}}</a></div>
                                            <div class="userhelp-new">
                                                {{data.content}}
                                            </div>
                                        </router-link>  
                                    </li>
                                </a> 
						</ul>
					</div>
					</div>
				</div>
			</div>
		</div>
</template>
<script>
import Help from '../../../store/help.js'
export default {
    data(){
        return {
            name:'',
            datas:[],
            content:'',
            pmCode:''
        }
    },
    methods:{
        getDatas:function(content){
            this.axios.get('/ietm/user/help',{
                params:{
                    content:content
                }
            }).then(res=>{
               this.datas = res.data;
            })
        },
        toHelp:function(){
            this.$emit('returnflag',true);
        },
       
    },
    created(){
        this.getDatas('');
    },
    mounted(){
        Help.$on('val', (data) => {
        this.axios.get('/ietm/user/help',{
                params:{
                    content:data.content,
                    pmCode:data.pmCode,
                    modelIdentCode:data.modelIdentCode,
                    systemCode:data.systemCode,
                    subSystemCode:data.subSystemCode,
                    assyCode:data.assyCode,
                    infoCode:data.infoCode,
                }
            }).then(res=>{
               this.datas = res.data;
            })
      })
    },
     /* watch:{
        $route:{
            handler(val,oldval){
                console.log("====="+val)
                console.log(oldval)
            },
            deep:true
        }
       '$route' (to,from)
        {
            console.log(to)
            console.log(from)
            if(from.name=='SuperSearchHelp')
            {
                this.axios.get('/ietm/user/help',{
                params:{
                    content:this.$route.params.content,
                    pmCode:this.$route.params.pmCode,
                    modelIdentCode:this.$route.params.modelIdentCode,
                    systemCode:this.$route.params.systemCode,
                    subSystemCode:this.$route.params.subSystemCode,
                    assyCode:this.$route.params.assyCode,
                    infoCode:this.$route.params.infoCode,
                }
                }).then(res=>{
                    this.datas = res.data;
                })
            }
        } 
    }*/
}





</script>
<style scoped>
@import url('../../../assets/css/content.css');
@import url('../../../assets/css/animation.css');
</style>

